// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

import PanelAnimation from "./PanelAnimation";

const { ccclass, property } = cc._decorator;

@ccclass
export default class TestPanelAnimation extends PanelAnimation {
    @property(cc.Node)
    content: cc.Node = null;

    public playOpenAnimaiton(): void {
        cc.tween(this.content).set({ scale: 0 }).to(0.25, { scale: 1 }).call(this.onOpenAnimationEnd, this).start();
    }

    public playCloseAnimation(): void {
        cc.tween(this.content).set({ scale: 1 }).to(0.25, { scale: 0 }).call(this.onCloseAnimationEnd, this).start();
    }
}
